<?php

namespace App\Http\Controllers\Backend;


use App\Manage\AdminManage;
use App\Manage\GoodsManage;
use App\Manage\OrderManage;

class OrderController extends BaseController
{

    // 成员管理
    public function initialize()
    {
        parent::initialize();
    }

    // 父级
    // 添加，修改，删除，列表，停用 操作


    // 返回列表数据

    // 返回列表数据
    public function lists()
    {
        // 设置语言

        // 执行翻译
        // __('messages.login') ;

        $options = ['is_admin_log' => 0, 'is_admin_role' => 0,];
        $logic   = new OrderManage();

        return $this->onLists($logic, $options);
    }

    // 查找
    public function show()
    {
        $options = ['is_admin_log' => 0, 'is_admin_role' => 0,];
        $logic   = new OrderManage();

        return $this->onShow($logic, $options);
    }

    // 发货
    public function send()
    {
        $options = ['is_admin_log' => 1, 'is_admin_role' => 0,];
        $logic   = new OrderManage();


        // 执行
        $res = $logic->send($this->myUser, $options);
        if($res === false){
            return $this->error($logic->getError());
        }

        return $this->success();
    }

    // 软删除
    public function soft()
    {
        $options = ['is_admin_log' => 0, 'is_admin_role' => 0,];
        $logic   = new OrderManage();

        return $this->onSoft($logic, 'status', $options);
    }


}


